<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript">
function validate(){
	if(form.username.value==""){
		alert("用户名不能为空");	
		return false;
	}
	if(form.username.value.indexOf(",")>-1||form.username.value.indexOf("，")>-1){
		alert("用户名不能包含逗号");	
		return false;
	}
	
	if(form.nickname.value==""){
		alert("昵称不能为空");	
		return false;
	}
	if(form.password.value==""){
		alert("密码不能为空");	
		return false;
	}
	if(form.password2.value==""){
		alert("确认密码不能为空");	
		return false;
	}
	if(form.password2.value!=form.password.value){
		alert("密码不相同，请重新输入");	
		return false;
	}
}
</script>
<title>注册</title>
</head>
<body>
<form action="RegisterServlet" method="post" onsubmit="return validate();" name="form">
     <h1 align="center" style="color:red">请注册</h1>
     <div align="center" class="register">
                  用户名:<br><input name="username"><br>
                   昵称 :<br><input name="nickname"> <br>         
                      密码:<br><input type="password" name="password"><br>
               确认密码 :<br><input type="password" name="password1"><br>
       <input type="submit" value="注册">
       <input type="button" value="登录" onclick="window.location.href='Login.html';">                                
     </div>
</form>
</body>
</html>